-
Notifications
You must be signed in to change notification settings - Fork 1
Feature/ASAA-23 Compose UI x Karumi Shot Testing #85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
…oid-ArchitectureDemo into feature/karumui_shots
…oid-ArchitectureDemo into feature/ASAA-23-karumi
BottleRocket-Colin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to adjust font size so screen shots look reasonable?
|
@BottleRocket-Colin so the font size is still a pending questions for me. The tests are suppose to run as and we shouldn't have to add that but I will continue to look into solution. |
| compareScreenshot(composeRule.onRoot()) | ||
| } | ||
|
|
||
| fun renderComponent(state: HomeScreenState? = null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Br-DiorD Think I figured out our issue. We should wrap HomeScreen like this:
ArchitectureDemoTheme {
HomeScreen(state)
}
Also, Could HomeScreenState in function signature be non null?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@BottleRocket-Colin nice! I'll give it a shot after this meeting. I do wonder why it is only an issue on certain screenshots because the Pull RequestScreenshot shot is fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Br-DiorD _ would say that the PR request screenshot is probably not correct but just closer to being correct. It's a matter of where our h4 and h5 typographies are closer to the default sizes but our h1 is very small compared to the h1 default. So some screens will show closer to correct than others depending on which typography elements are being used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@BottleRocket-Colin fixed. Sorry for the delay :)
|
@Br-DiorD I'll take a look at this tomorrow and provide some feedback! |
jaredstockton
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that I'm currently unable to execute the tests OR record new screenshots for my API 31 Pixel 4 emulator. I'm going to continue to look into this.
@Br-DiorD It would be awesome if there was some way to dictate the emulator configuration to be used to run the tests so any dev would be able to run the tests on their machine and get the same results. If there isn't a programmatic way to do that, even just listing the emulator configuration in the README.md would be helpful
app/src/androidTest/java/com/bottlerocketstudios/brarchitecture/HomeScreenUITest.kt
Outdated
Show resolved
Hide resolved
app/src/androidTest/java/com/bottlerocketstudios/brarchitecture/PullRequestScreenshotTest.kt
Outdated
Show resolved
Hide resolved
app/src/androidTest/java/com/bottlerocketstudios/brarchitecture/PullRequestScreenshotTest.kt
Outdated
Show resolved
Hide resolved
app/src/androidTest/java/com/bottlerocketstudios/brarchitecture/HomeScreenUITest.kt
Outdated
Show resolved
Hide resolved
tldr; Turns out I needed to uninstall a previously installed Architecture Demo build before attempting to run the integration tests. Findings: |
…d add a shot html report launch script.
…oid-ArchitectureDemo into feature/ASAA-23-karumi � Conflicts: � app/src/main/java/com/bottlerocketstudios/brarchitecture/ui/repository/RepositoryCommitViewModel.kt
|
@br-jared-stockton Got to remind myself to add this to the confluence but yes you have to uninstall previous app version IOT get the test to run because the addition of the sharedUserId in the Manifest requires a complete reboot to implement itself i guess. |
@Br-DiorD This is the last thing I'd like to see done for this PR, primarily so that devs/CI can setup an emulator to get consistent results (meaning any team member could setup their emulator with some given configuration and run the snapshot tests successfully). I imagine that the emulator would match the emulator used to check in the screenshots :) |
|
@br-jared-stockton on it. I don't remember having to do anything on the emulator for it to work so I'm going to create a new 1 and start from scratch to see what happens 👍 |
…oid-ArchitectureDemo into feature/ASAA-23-karumi � Conflicts: � buildSrc/src/main/kotlin/Dependencies.kt
|
@br-jared-stockton updated with link to Confluence where I added Emulator setup steps. Link can be found in both the Base test file and the README.md file. |
…e the correct theme
@Br-DiorD I was thinking of something more along the lines of the scripts that are in the shot-consumer folder of the shot dependency: https://github.com/pedrovgs/Shot/tree/master/shot-consumer/scripts The idea is that a new developer would be able to execute You could copy/paste those initial scripts into the architecture demo project and then tweak to suite (if you want to use api 31 and different screen width/height values, etc). Then you'd need to retake all screenshots with the emulator created from the script. Once all of that is done, then anybody would be able to run the screenshot tests and take new ones that match the existing emulator criteria without having to manually create/configure a new emulator on their machine :D |
jaredstockton
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See previous comment
Initial implementation of the Karumi Screenshot testing package with Compose UI testing combined.
Code uses Compose UI tests to collect the screenshots and karumi to save and compare them
Please see the Screenshot Testing: Compose UI x Karumi Confluence page created